<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreAddress extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'province_name' => 'required',
            'city_name'     => 'required',
            'district_name' => 'required',
            'province_id'   => 'required|number',
            'city_id'       => 'required|number',
            'district_id'   => 'required|number',
            'address'       => 'required',
            'consignee'     => 'required',
            'mobile'        => 'required|number',
        ];
    }

    public function attributes()
    {
        return [
            'province_name' => '省',
            'city_name'     => '城市',
            'district_name' => '地区',
            'province_id'   => '省',
            'city_id'       => '城市',
            'district_id'   => '地区',
            'address'       => '详细地址',
            'consignee'     => '联系人',
            'mobile'        => '联系电话',
        ];
    }
}
